.class public Lcom/adview/adapters/InmobiAdapter;
.super Lcom/adview/adapters/AdViewAdapter;
.source "InmobiAdapter.java"


# instance fields
.field private mAdRequest:Lcom/inmobi/androidsdk/IMAdRequest;

.field private mIMAdListener:Lcom/inmobi/androidsdk/IMAdListener;

.field private mIMAdView:Lcom/inmobi/androidsdk/IMAdView;


# direct methods
.method public constructor <init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V
    .locals 1
    .parameter "adViewLayout"
    .parameter "ration"

    .prologue
    .line 25
    invoke-direct {p0, p1, p2}, Lcom/adview/adapters/AdViewAdapter;-><init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V

    .line 21
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdView:Lcom/inmobi/androidsdk/IMAdView;

    .line 62
    new-instance v0, Lcom/adview/adapters/InmobiAdapter$1;

    invoke-direct {v0, p0}, Lcom/adview/adapters/InmobiAdapter$1;-><init>(Lcom/adview/adapters/InmobiAdapter;)V

    iput-object v0, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdListener:Lcom/inmobi/androidsdk/IMAdListener;

    .line 26
    return-void
.end method

.method static synthetic access$0(Lcom/adview/adapters/InmobiAdapter;)Lcom/inmobi/androidsdk/IMAdView;
    .locals 1
    .parameter

    .prologue
    .line 21
    iget-object v0, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdView:Lcom/inmobi/androidsdk/IMAdView;

    return-object v0
.end method


# virtual methods
.method public handle()V
    .locals 6

    .prologue
    const/4 v5, 0x0

    .line 31
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v2

    sget-object v3, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v2, v3, :cond_0

    .line 32
    const-string v2, "AdView SDK v1.7.0"

    const-string v3, "Into Inmobi"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 33
    :cond_0
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/adview/AdViewLayout;

    .line 34
    .local v1, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v1, :cond_2

    .line 61
    :cond_1
    :goto_0
    return-void

    .line 38
    :cond_2
    iget-object v2, v1, Lcom/adview/AdViewLayout;->activityReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    .line 39
    .local v0, activity:Landroid/app/Activity;
    if-eqz v0, :cond_1

    .line 44
    new-instance v2, Lcom/inmobi/androidsdk/IMAdView;

    const/16 v3, 0xf

    .line 45
    iget-object v4, p0, Lcom/adview/adapters/InmobiAdapter;->ration:Lcom/adview/obj/Ration;

    iget-object v4, v4, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    invoke-direct {v2, v0, v3, v4}, Lcom/inmobi/androidsdk/IMAdView;-><init>(Landroid/app/Activity;ILjava/lang/String;)V

    .line 44
    iput-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdView:Lcom/inmobi/androidsdk/IMAdView;

    .line 46
    new-instance v2, Lcom/inmobi/androidsdk/IMAdRequest;

    invoke-direct {v2}, Lcom/inmobi/androidsdk/IMAdRequest;-><init>()V

    iput-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mAdRequest:Lcom/inmobi/androidsdk/IMAdRequest;

    .line 47
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v2

    sget-object v3, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v2, v3, :cond_3

    .line 48
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mAdRequest:Lcom/inmobi/androidsdk/IMAdRequest;

    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Lcom/inmobi/androidsdk/IMAdRequest;->setTestMode(Z)V

    .line 54
    :goto_1
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdView:Lcom/inmobi/androidsdk/IMAdView;

    iget-object v3, p0, Lcom/adview/adapters/InmobiAdapter;->mAdRequest:Lcom/inmobi/androidsdk/IMAdRequest;

    invoke-virtual {v2, v3}, Lcom/inmobi/androidsdk/IMAdView;->setIMAdRequest(Lcom/inmobi/androidsdk/IMAdRequest;)V

    .line 55
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdView:Lcom/inmobi/androidsdk/IMAdView;

    iget-object v3, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdListener:Lcom/inmobi/androidsdk/IMAdListener;

    invoke-virtual {v2, v3}, Lcom/inmobi/androidsdk/IMAdView;->setIMAdListener(Lcom/inmobi/androidsdk/IMAdListener;)V

    .line 56
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdView:Lcom/inmobi/androidsdk/IMAdView;

    invoke-virtual {v1, v2}, Lcom/adview/AdViewLayout;->addView(Landroid/view/View;)V

    .line 57
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mIMAdView:Lcom/inmobi/androidsdk/IMAdView;

    new-instance v3, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-direct {v3, v5, v5}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v2, v3}, Lcom/inmobi/androidsdk/IMAdView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    goto :goto_0

    .line 49
    :cond_3
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v2

    sget-object v3, Lcom/adview/AdViewTargeting$RunMode;->NORMAL:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v2, v3, :cond_4

    .line 50
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mAdRequest:Lcom/inmobi/androidsdk/IMAdRequest;

    invoke-virtual {v2, v5}, Lcom/inmobi/androidsdk/IMAdRequest;->setTestMode(Z)V

    goto :goto_1

    .line 52
    :cond_4
    iget-object v2, p0, Lcom/adview/adapters/InmobiAdapter;->mAdRequest:Lcom/inmobi/androidsdk/IMAdRequest;

    invoke-virtual {v2, v5}, Lcom/inmobi/androidsdk/IMAdRequest;->setTestMode(Z)V

    goto :goto_1
.end method
